
import fetch from 'common/src/utils/fetch';
import baseUrl from './env';
import UTILS from "common/src/utils/utils";

//获取学分认定开关设置
export function getSetting() {
    return fetch({
        url: `${baseUrl}exchangesConfig/page`,
        method: 'post'
    })
}
//保存学分认定开关设置
export function saveSetting(data) {
    return fetch({
        url: `${baseUrl}exchangesConfig/saveConfig`,
        method: 'post',
        data
    })
}
//查询短期交流生管理列表
export function getTableList(data) {
    return fetch({
        url: `${baseUrl}shortExchangeName/page`,
        method: 'post',
        data
    })
}
//查询学生基本信息
// export function queryStudentInfo(id) {
//     return fetch({
//         url: `${baseUrl}ug/exchanges/student?studentId=${id}`,
//         method: 'get'
//     })
// }
//新增短期交流学生
export function addExchangeStudent(data){
    return fetch({
        url:`${baseUrl}shortExchangeName/addExchangeName`,
        method:'post',
        data
    })
}
//删除短期交流项目学生列表
export function deleteExchangeNameList(data){
    return fetch ({
        url:`${baseUrl}shortExchangeName/deleteExchangeNameList`,
        method:'post',
        data
    })
}
//查询国际交流统计
export function queryStatis(data){
    return fetch ({
        url:`${baseUrl}exchangesCountQuery/page`,
        method:'post',
        data
    })
}
//国际交流导出
export function exportExcelList(data){
    return fetch({
        url: `${baseUrl}exchangesCountQuery/exportExcelList`,
        responseType: 'blob',
        method: 'post',
        data
    }).then(res => {
        UTILS.downloadFile(res, '国际交流统计导出.xls', 'application/vnd.ms-excel;charset=utf-8');
    });
}
